package dto

import (
	"github.com/gogf/gf/v2/os/gtime"
)

// ZlycMigrateUsers 智链影创-棘祥源用户迁移记录表
type ZlycMigrateUsers struct {
	Id            uint64      `json:"id"             orm:"id,primaryKey" comment:"id"`
	Phone         string      `json:"phone"          orm:"phone" comment:"账号"`
	UserName      string      `json:"user_name"      orm:"user_name" comment:"姓名"`
	PaperPointSum float64     `json:"paper_point_sum" orm:"paper_point_sum" comment:"纸质积分总计"`
	TablePointSum float64     `json:"table_point_sum" orm:"table_point_sum" comment:"莲花宝典数据表积分总计"`
	ZlycPhone     string      `json:"zlyc_phone"      orm:"zlyc_phone" comment:"文创账号"`
	Referrer      string      `json:"referrer"       orm:"referrer" comment:"推荐人"`
	Remark        string      `json:"remark"         orm:"remark" comment:"备注说明"`
	Status        int8        `json:"status"         orm:"status" comment:"状态,0:待处理,1:处理成功,-1:处理失败,-2:冻结账号不处理"`
	Res           string      `json:"res"            orm:"res" comment:"处理结果"`
	CreateTime    *gtime.Time `json:"create_time"    orm:"create_time" comment:"创建时间"`
	UpdateTime    *gtime.Time `json:"update_time"    orm:"update_time" comment:"修改时间"`
}

// UserInfo 用户信息表
type ZlycUserInfo struct {
	Id                          int         `json:"id"                          orm:"id,primaryKey,autoIncrement" comment:"主键"`
	UserNum                     string      `json:"user_num"                    orm:"user_num,unique" comment:"用户编号(推荐码)"`
	Username                    string      `json:"username"                    orm:"username,primaryKey,unique" comment:"用户名"`
	Password                    string      `json:"password"                    orm:"password" comment:"密码"`
	VxNum                       string      `json:"vx_num"                      orm:"vx_num" comment:"微信号"`
	UserType                    int         `json:"user_type"                   orm:"user_type" comment:"用户类型(1.普通会员  2.有效会员  3.店长  4.销售股东  5.超级管理员)"`
	RealName                    string      `json:"real_name"                   orm:"real_name" comment:"用户姓名"`
	Phone                       string      `json:"phone"                       orm:"phone" comment:"电话"`
	IdentityNumber              string      `json:"identity_number"             orm:"identity_number" comment:"身份证号"`
	UserBankName                string      `json:"user_bank_name"              orm:"user_bank_name" comment:"开户姓名"`
	BankNum                     string      `json:"bank_num"                    orm:"bank_num" comment:"银行卡号"`
	BankName                    string      `json:"bank_name"                   orm:"bank_name" comment:"开户行"`
	BankBranchName              string      `json:"bank_branch_name"            orm:"bank_branch_name" comment:"银行支行名称"`
	BankProvince                string      `json:"bank_province"               orm:"bank_province" comment:"开户省份"`
	BankCity                    string      `json:"bank_city"                   orm:"bank_city" comment:"开户市"`
	IsShared                    int         `json:"is_shared"                   orm:"is_shared" comment:"是否可分享(1.可以分享  2.不能分享)"`
	Shared                      int         `json:"shared"                      orm:"shared" comment:"分享人(上级id)"`
	DirectSalesUserCount        int         `json:"direct_sales_user_count"     orm:"direct_sales_user_count" comment:"直接销售用户数量"`
	GreenPointsAmount           float64     `json:"green_points_amount"        orm:"green_points_amount" comment:"绿色积分数量"`
	GreenPointsUpdateTime       *gtime.Time `json:"green_points_update_time"    orm:"green_points_update_time" comment:"绿色积分更新时间"`
	ConsumptionPointsAmount     float64     `json:"consumption_points_amount"  orm:"consumption_points_amount" comment:"消费积分数量"`
	ConsumptionPointsUpdateTime *gtime.Time `json:"consumption_points_update_time" orm:"consumption_points_update_time" comment:"消费积分更新时间"`
	ExchangeCoupon              int         `json:"exchange_coupon"             orm:"exchange_coupon" comment:"兑换券数量"`
	CopyrightCount              int         `json:"copyright_count"             orm:"copyright_count" comment:"版权数量"`
	TotalAmountConsumed         float64     `json:"total_amount_consumed"      orm:"total_amount_consumed" comment:"消费总金额"`
	RealNameStatus              int         `json:"real_name_status"            orm:"real_name_status" comment:"实名审核状态(1.待提交  2.待审核  3.审核通过  4.审核不通过)"`
	RealNameStatusUpdateTime    *gtime.Time `json:"real_name_status_update_time" orm:"real_name_status_update_time" comment:"实名状态更改时间"`
	RealNameFailRemark          string      `json:"real_name_fail_remark"       orm:"real_name_fail_remark" comment:"实名审核失败原因"`
	BankCardStatus              int         `json:"bank_card_status"            orm:"bank_card_status" comment:"银行卡审核状态(1.待提交  2.待审核  3.审核通过  4.审核不通过)"`
	BankCardStatusUpdateTime    *gtime.Time `json:"bank_card_status_update_time" orm:"bank_card_status_update_time" comment:"银行卡状态更改时间"`
	BankCardFailRemark          string      `json:"bank_card_fail_remark"       orm:"bank_card_fail_remark" comment:"银行卡审核失败原因"`
	IdentityCardFrontImgId      int         `json:"identity_card_front_img_id"  orm:"identity_card_front_img_id" comment:"身份证正面照片id"`
	IdentityCardReverseImgId    int         `json:"identity_card_reverse_img_id" orm:"identity_card_reverse_img_id" comment:"身份证反面照片id"`
	BankCardImgId               int         `json:"bank_card_img_id"            orm:"bank_card_img_id" comment:"银行卡照片id"`
	CreateTime                  *gtime.Time `json:"create_time"                 orm:"create_time" comment:"注册时间"`
	UpdateTime                  *gtime.Time `json:"update_time"                 orm:"update_time" comment:"修改时间"`
	IsDeleted                   int         `json:"is_deleted"                  orm:"is_deleted" comment:"是否删除"`
}

// OrderInfo 订单信息表
type OrderInfo struct {
	Id                      int         `json:"id"                     orm:"id,primaryKey,autoIncrement" comment:"主键"`
	OrderNum                string      `json:"order_num"              orm:"order_num" comment:"订单编号"`
	UserId                  int         `json:"user_id"                orm:"user_id" comment:"购买用户的用户id"`
	ProductId               int         `json:"product_id"             orm:"product_id" comment:"产品id"`
	ProductCount            int         `json:"product_count"          orm:"product_count" comment:"购买数量"`
	Price                   float64     `json:"price"                 orm:"price" comment:"总价格"`
	OriginalPrice           float64     `json:"original_price"        orm:"original_price" comment:"原价"`
	PayType                 int         `json:"pay_type"               orm:"pay_type" comment:"支付方式(1.微信  2.支付宝  3.积分支付)"`
	OrderType               int         `json:"order_type"             orm:"order_type" comment:"订单类型(1.现金购买产品   2.积分购买产品  3.版权置换)"`
	Status                  int         `json:"status"                 orm:"status" comment:"订单状态(1.待支付 2.待发货 3.待收货 4.已完成 5.已取消)"`
	Addr                    int         `json:"addr"                   orm:"addr" comment:"地址id"`
	Phone                   string      `json:"phone"                  orm:"phone" comment:"收货人电话"`
	ConsigneeName           string      `json:"consignee_name"         orm:"consignee_name" comment:"收货人姓名"`
	Province                string      `json:"province"               orm:"province" comment:"省"`
	City                    string      `json:"city"                   orm:"city" comment:"市"`
	District                string      `json:"district"               orm:"district" comment:"区"`
	DetailAddress           string      `json:"detail_address"         orm:"detail_address" comment:"详细地址"`
	OrderCreateTime         *gtime.Time `json:"order_create_time"      orm:"order_create_time" comment:"订单生成时间"`
	OrderPaidTime           *gtime.Time `json:"order_paid_time"        orm:"order_paid_time" comment:"订单支付时间"`
	Invoice                 string      `json:"invoice"                orm:"invoice" comment:"发票"`
	LogisticsTrackingNumber string      `json:"logistics_tracking_number" orm:"logistics_tracking_number" comment:"物流单号"`
	LogisticsCompany        string      `json:"logistics_company"      orm:"logistics_company" comment:"物流公司"`
	StatusUpdateTime        *gtime.Time `json:"status_update_time"     orm:"status_update_time" comment:"订单发货时间"`
	OrderCompletionTime     *gtime.Time `json:"order_completion_time"  orm:"order_completion_time" comment:"订单完成时间"`
	IsDeleted               int         `json:"is_deleted"             orm:"is_deleted" comment:"是否删除"`
}

// UserOrderGreenIntegral 用户订单绿色积分表
type UserOrderGreenIntegral struct {
	Id                   int         `json:"id"                     orm:"id,primaryKey,autoIncrement" comment:"主键"`
	UserId               int         `json:"user_id"                orm:"user_id" comment:"用户id"`
	OrderId              int         `json:"order_id"               orm:"order_id" comment:"订单id"`
	ResidueGreenIntegral float64     `json:"residue_green_integral" orm:"residue_green_integral" comment:"该订单剩余绿色积分"`
	AccelerationRatio    float64     `json:"acceleration_ratio"     orm:"acceleration_ratio" comment:"加速释放比例"`
	UpdateTime           *gtime.Time `json:"update_time"            orm:"update_time" comment:"更新时间"`
	CreateTime           *gtime.Time `json:"create_time"            orm:"create_time" comment:"创建时间"`
}

// 智链影创-请求参数
type RegisterZlycUserParam struct {
	SharedCode string `json:"sharedCode"`
	UserName   string `json:"username"`
}
